package com.zmj.aspectj;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class LoggerAspectj {
    Logger logger= LogManager.getLogger(LoggerAspectj.class);

    @Pointcut("execution(* com.zmj.service..*(..))")
    public void qrd(){

    }

@Before("qrd()")
    public void  beforeLogger(JoinPoint joinPoint){
        logger.info("前置通知：记录一下方法的名称"+joinPoint.getTarget().toString()+":"+joinPoint.getSignature().toString());
}

}
